﻿using System;
using System.Collections.Generic;
using System.Text;

namespace WikiDoc.Formatter
{
    /// <summary>
    /// 
    /// </summary>
    public class XmlDocSummaryFormatter : XmlDocFormatter
    {
        /// <summary>
        /// 初始化 <see cref="XmlDocSummaryFormatter"/> 类的新实例.
        /// </summary>
        public XmlDocSummaryFormatter(System.IO.TextWriter writer) : base(writer)
        {
        }

        /// <summary>
        /// Begins the tag.
        /// </summary>
        /// <param name="tag">The tag.</param>
        public override void BeginTag(string tag)
        {
            base.BeginTag(tag);

            if (tag == "li")
            {
                Writer.Write("><para>");
                Writer.Write(new string('　', ListLevel * 2));
                Writer.Write("● ");
                State = WriteState.BeforeContent;
            }
        }

        /// <summary>
        /// Ends the tag.
        /// </summary>
        /// <param name="tag">The tag.</param>
        public override void EndTag(string tag)
        {

            if (tag == "li")
            {
                Writer.Write("</para>");
            }

            base.EndTag(tag);
        }
    }
}
